package lingou.homework.postbar.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import lingou.homework.postbar.domain.Newspost;
import lingou.homework.postbar.domain.Post;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NewsPostMapper extends BaseMapper<Newspost> {

    @Select("select * from news_post natural join post limit #{start}, #{count}")
    List<Post> getPosts(@Param("start") long start,
                        @Param("count") long count);
}
